Skip to content

Fix help text - #20

Merged
HaoZeke merged 2 commits into
mainfrom
fix/help-text
Nov 17, 2026
Merged

HaoZeke merged 2 commits into
mainfrom
fix/help-text

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

The shell script's --help printed lines 2 to 23 of the script and stopped mid-sentence: a blank line and half of the comment after the usage. The Zig build's usage stopped earlier still, and COMPAT.md listed the difference as deliberate.

Both builds now print the same complete usage, from a here-document in the shell script and from usage_text in the Zig build: every option in both forms (-h and --OPTION=VALUE included) with its default, the environment variables, and the exit statuses 0, 2 and 75, last. The usage and the README now say that rotate takes the runs at least DAYS old. COMPAT.md lists the usage as kept.

The suite reads the options from both parsers and checks that --help lists each of them with its default or that it is required. A --help/-h differential compares the two builds, a Zig unit test ties the text to default_lock_timeout, lock_busy_exit and cli.usage_exit, and --help still names --lock-timeout, as eb-pipeline's probe reads it.

On the base, 8 of 9 of those checks fail for each build, and the differential has 3 differences. At this tip, the 8 pass and the differential differences are 0.

The shell script printed lines 2 to 23 of itself as its usage: a range
moved by hand each time the usage grew, and two lines too long in every
version, so --help, -h and no arguments ended with a blank line and
half a sentence of the comment after the usage. The Zig build's usage
stopped before those lines, and COMPAT.md listed the difference as
deliberate. Neither named -h or the --OPTION=VALUE forms, said that
--compress-after is required or that --delete-after has no default, or
gave an exit status but 75, and the default of --lock-timeout was in a
sentence about the lock. Both said that rotate takes the runs older
than DAYS, where it takes the runs at least DAYS old.

The shell script's usage is now a quoted here-document, and the Zig
build's usage_text holds the same text: each command, each of rotate's
options in both forms with what it does and its default, the
environment variables, and the exit statuses 0, 2 and 75, last.
COMPAT.md lists the usage as kept.

The suite reads the options from both parsers, the shell script's case
patterns and the Zig build's comparisons of an argument, and checks
that --help lists each of them, that each option that takes a value
gives its default or says it is required, that --lock-timeout waits
600 seconds by default, and that the exit statuses are 0, 2 and 75.
It checks that --help, -h and no arguments print the usage whole, with
every paragraph ending in a full stop and the exit statuses last, and
that --help exits 0 and names --lock-timeout, as eb-pipeline reads it.
The differential run compares --help and -h, and passes a difference
only while COMPAT.md lists its case among the deliberate differences.
A unit test checks that usage_text gives default_lock_timeout,
lock_busy_exit and cli.usage_exit.
The reference's synopsis and its exit status 0 named --help but not
-h. They name both now, and the reference shows the usage under
--help, as it shows the version line under --version. The suite
checks that the example there is what --help prints, so a change to
the usage that misses the reference fails.

README.md said that rotate compresses and removes the runs older than
DAYS. It says at least DAYS old, as the usage, the reference and the
how-to do.
@HaoZeke
HaoZeke merged commit 6de0262 into main Nov 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant